package com.sz.common.base.utils;

import java.lang.reflect.Field;

/**
 * Package: com.sz.common.base.utils<br>
 * Function: TODO: ADD FUNCTION <br>
 * Author: yanhong.xiao.<br>
 * Date: 2017-11-28 10:55:00.
 */
public class ObjectUtils extends org.springframework.util.ObjectUtils {
    public static boolean checkFieldValueNull(Object bean) {
        boolean result = true;
        if (bean == null) {
            return true;
        }
        Class<?> cls = bean.getClass();
        Field[] fields = cls.getDeclaredFields();
        for (Field field : fields) {
            field.setAccessible(true);
            try {

                if (field.get(bean) != null) {
                    return false;
                }
            } catch (IllegalAccessException e) {
              throw  new RuntimeException();
            }
        }
        return result;
    }


    public static boolean isNotEmpty(Object obj) {
        return !isEmpty(obj);
    }


}
